import { Navigate } from "react-router-dom";
import { lazy ,Suspense} from "react";
import Loading from "../component/Loading/Loading"

let NotFound = lazy(() => import("../view/NotFound/NotFound"))
let Work = lazy(() => import('../view/Index/Work/Work'))
let Mydata = lazy(() => import('../view/Index/MyData/Mydata'))
let ResetPass = lazy(() => import('../view/Index/ResetPass/ResetPass'))

let Workbench: any = [
    { path: '/index/work', element: <Suspense fallback={<Loading/>}><Work /> </Suspense>},
    { path: '/index/mydata', element:<Suspense fallback={<Loading/>}> <Mydata /> </Suspense>},
    { path: '/index/resetpass', element: <Suspense fallback={<Loading/>}><ResetPass /></Suspense> },
    { path: '/index', element: <Navigate to="/index/work" /> },
    { path: "*", element: <Suspense fallback={<Loading/>}><NotFound /></Suspense> }
]

export default Workbench